#include <iostream>
#include <vector>

using namespace std;

int main() {
    size_t n, m;
    unsigned long k;
    cin >> n >> m >> k;

    vector< unsigned long  > values( n );
    for ( size_t q = 0; q < n; q++ ) {
        cin >> values[ q ];
    }
    vector< unsigned long  > looktimes( n );
    for ( size_t q = 0; q < n; q++ ) {
        cin >> looktimes[ q ];
    }

    vector< vector< int > > gototimes( n, vector< int >( n, -1 ) );
    
    int                     i, j, t;
    for ( size_t q = 0; q < m; q++ ) {
        cin >> i >> j >> t;
        gototimes[ i-1 ][ j-1 ] = t;
    }

    size_t maxValue = 0;
    size_t usedTime = 0;
    size_t minTime = 10E9+1;

    for ( i = 0; i < n; i++ ) {
        usedTime = looktimes[ i ];

        for ( j = 0; j < n; j++ ) {
            if ( i == j || gototimes[i][j] == -1 || gototimes[i][j ] > k 
                ||gototimes[i][j ] + looktimes[ j ] + usedTime > k ) {
                continue;
            }
            usedTime += gototimes[i][j] + looktimes[ j ];

            for ( size_t q = 0; q < n; q++ ) {
                if ( i == j || i == q || j == q ) {
                    continue;
                }
                if ( gototimes[j][q] == -1 ||  gototimes[j][q] > k 
                    || usedTime + gototimes[j][q] + looktimes[ q ] > k ) {
                    continue;
                }
                usedTime += gototimes[j][q] + looktimes[q];
                if ( usedTime < minTime ) {
                    maxValue = values[ i ] + values[ j ] + values[ q ];
                }
            }
        }
    }
    cout << maxValue;

    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <map>


using namespace std;

bool isHuiwen(string s){
    int i = 0;
    int j = s.size()-1;
    
    while(i < j && i< s.size() && j>=0){
        if(s[i]!=s[j])
            return false;
        i++;
        j--;
    }
    return true;
}

int main(){
    int num = 0;
    cin >> num;
    
    for(size_t k = 0 ; k< num ;k++){
        string s;
        cin >> s;
        if(isHuiwen(s)){
            cout<<"YES"<<endl;
        }else{
            cout<<"NO"<<endl;
        }
    }
    
    return 0;
}


int main(){
    int num = 0;
    cin >> num;
    
    map<std::string ,int > m_map;
    set<string> learnd;
    
    int i = 1;
    int nResult = 0;
    for(size_t k = 0 ; k< num ;k++){
        string s;
        cin >> s;
        auto result = m_map.insert(make_pair(s,1));
        
        if(result.second == true){
           if(i ==1 ){
               learnd.insert(s);
               nResult++;
               i++;
           }
       }else{
           result.first->second++;
           if(i == result.first->second && learnd.find(s) == learnd.end()){
               learnd.insert(s);
               nResult++;
               i++;
           }
       } 
    }
    cout<<nResult;
    return 0;
}